package com.example.myapplication2030606131wjw;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private EditText editTxtMainusername;
    private Button btnMainLogin;
    private EditText editTxtMainpassword;
    private TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        btnMainLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(MainActivity.this,ShowDataActivity1.class);
               intent.putExtra("userName",editTxtMainusername.getText().toString().trim());

               Bundle bundle = new Bundle();
               bundle.putString("passWord",editTxtMainpassword.getText().toString().trim());
               intent.putExtras(bundle);
                startActivity(intent);
            }
        });
    }

    private void initView() {
        editTxtMainusername = (EditText) findViewById(R.id.editTxt_mainusername);
        btnMainLogin = (Button) findViewById(R.id.btn_mainLogin);
        editTxtMainpassword = (EditText) findViewById(R.id.editTxt_mainpassword);
        textView = (TextView) findViewById(R.id.textView);
    }
}